﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OpenQuarters.WebQuarters.Utils
{
    public class Image
    {
        public struct ImageDimensions
        {
            public string width { get; set; }
            public string height { get; set; }
        }

        public static ImageDimensions GetImageSize(string imagepath)
        {
            System.Drawing.Image image = System.Drawing.Image.FromFile(imagepath);

            ImageDimensions dimensions = new ImageDimensions();
            dimensions.width = image.Width.ToString();
            dimensions.height = image.Height.ToString();
            
            image.Dispose();
            return dimensions;
        }

    }
}
